<template>
  <div>
    <div v-for="(item, index) in list" :key="item">
      <span>{{ item }}</span>
      <span v-if="(index + 1) % 3 === 0"> 123434 </span>
    </div>

    <div>{{ chaifen }}</div>
    <div>
      <div v-for="item in chaifen" :key="item.toString()">
        <template v-if="item instanceof Array">
          <span v-for="(cItem, index) in item" :key="index">{{ cItem }}</span>
        </template>
      </div>
    </div>
  </div>
</template>
<script>
export default {
  name: 'forTest',
  components: {},
  data() {
    return {
      list: [0, 1, 2, 3, 4, 5, 6, 7, 8],
      newList: []
    }
  },
  created() {
    this.chaifen = 3
  },
  computed: {
    chaifen: {
      get: function () {
        return this.newList
      },
      set: function (v) {
        console.log(v)
        this.newList = [this.list.slice(0, v), this.list.slice(v)]
      }
    }
  },
  methods: {},
  activated: {},
  deactivated: {}
}
</script>

<style lang="less" scoped></style>
